package feng.demo.dao;

import feng.demo.entity.Commodity;
import feng.demo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CommodityDao {
    List<Commodity> findAll();
    Commodity findById(Integer comid);
    List<Commodity> findByUid(Integer uid);
    List<Commodity> findByTypeid(Integer typeid);
    List<Commodity> findAllLimit(@Param("pagenum") Integer pagenum, @Param("lines")Integer lines);
    List<Commodity> findByIdLimit(@Param("comid") Integer comid,@Param("pagenum") Integer pagenum, @Param("lines")Integer lines);
    List<Commodity> findByUidLimit(@Param("uid") Integer uid,@Param("pagenum") Integer pagenum, @Param("lines")Integer lines);
    List<Commodity> findByTypeidLimit(@Param("typeid") Integer typeid,@Param("pagenum") Integer pagenum, @Param("lines")Integer lines);
    List<Commodity> findByCommodity(Map<String,Object>map);
    int add(Commodity commodity);
    int del(Integer comid);
    int update(Commodity commodity);
    int CountAll();
    int CountByTypeid(Integer typeid);
    List<Commodity> findBySort(@Param("pagenum") Integer pagenum, @Param("lines")Integer lines);
    int CountByUid(Integer uid);


    List<Commodity> findByque(String s);


    List<Commodity> findByCusUid(@Param("uid") Integer uid,@Param("pagenum") Integer pagenum, @Param("lines")Integer lines);
    int CountByCusUid(Integer uid);

}
